/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.com.menosehmais.business;

import br.com.caelum.vraptor.ioc.Component;
import br.com.menosehmais.framework.business.CrudBusinessObject;
import br.com.menosehmais.model.ContaDO;
import br.com.menosehmais.model.MarkedDO;
import br.com.menosehmais.model.PortletDO;
import br.com.menosehmais.persistence.MarkedDAO;

/**
 *
 * @author Junior JAFJ
 */
@Component
public class MarkedBO extends CrudBusinessObject<MarkedDO, MarkedDAO>{

    public MarkedBO(MarkedDAO dao) {
        super(dao);
    }
    
    public MarkedDO getObjectMarked(PortletDO portletDO, ContaDO contaDO) {
        MarkedDO markedDO = new MarkedDO();
        markedDO.setReferenceId(portletDO.getId());
        markedDO.setAccount(null); //TODO REFATOR APOS IMPLEMENTAR O LOGIN

        try {
            markedDO = dao.selectUsingFilter(markedDO).get(0);
        } catch (Exception e) {
            // TO-DO...
        }
        return markedDO;
    }
}
